package com.itheina.dao.impl;

import com.itheina.dao.AccountDao;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;

public class AccountDaoImpl implements AccountDao {
    //声明一个变量
    private QueryRunner queryRunner;

    @Override
    public void update() throws SQLException {
        //创建sql语句
        String sql = "update tal_account set username = ?,money = ? where id = ?";
        //参数的类型
        Object [] params = {"芦颖超",2000,2};
        //执行sql语句
        int result = queryRunner.update(sql, params);

        System.out.println(result);

    }

    public void setQueryRunner(QueryRunner queryRunner) {
        this.queryRunner = queryRunner;
    }
}
